package com.gitee.faster.webdav.kernel.model;

import jakarta.xml.bind.annotation.*;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Collections;
import java.util.List;

/**
 * @author hongda.li
 */
@Data
@Accessors(chain = true)
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
        "content"
})
@XmlRootElement(name = "owner")
public class Owner {

    @XmlMixed
    @XmlAnyElement(lax = true)
    private List<Object> content;

    public static Owner byName(String name) {
        Owner owner = new Owner();
        owner.setContent(Collections.singletonList(name));
        return owner;
    }
}
